package com.banyuan.utils;

import com.banyuan.domain.Author;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

public class AuthorUtils {



    public static Author getLoginAuthor(HttpServletRequest request) {
        Author author = (Author) request.getSession().getAttribute("author");
        return author;
    }

    public static String getLoginUserName(HttpServletRequest request) {
        Author author = (Author) request.getSession().getAttribute("author");
        return author.getUserName();
    }

    public static Integer getLoginId(HttpServletRequest request) {
        Author author = (Author) request.getSession().getAttribute("author");
        return author.getId();
    }
}
